package org.gap.wizards.creature;

import java.awt.Point;
import java.util.Collection;

import org.gap.wizards.Drawable;
import org.gap.wizards.items.Item;
import org.gap.wizards.utils.Persistable;
import org.gap.wizards.views.ViewPlatform;
import org.gap.wizards.world.Location;

public interface Creature extends Drawable, Persistable {
	public enum Attribute{
		Hitpoints, Hunger, HitModifier, ManaPoints, Strength, Intelligence
	};

	void setLocation(Point at);
	Point getLocation();

	/**
	 * Usually called when the creature dies. Has all contained items to be dropped at
	 * the creatures current location. (this can also include claws or teeth or skins 
	 * if those elements are given).
	 * @return
	 */
	Collection<Item> dropAllItems();

	/**
	 * Used to increase the current level in the attribute.  Does not effect it's
	 * maximum value.
	 * @param attr
	 * @param amountToIncrease
	 */
	void increase(Attribute attr, int amountToIncrease);

	/**
	 * Used to decrease the current level in the attribute.  Does not effect it's
	 * maximum value.
	 * @param attr
	 * @param amountToIncrease
	 */
	void decrease(Attribute hitpoints, int anyInt);
	
	/**
	 * Defines an attribute with the maximum, and the current level, such as:
	 * initAttribute(Hitpoints, 10, 5) where 10 is the maximum amount of hitpoints
	 * this player can have, but currently they have only half that amount (5), then
	 * will return 5.
	 * 
	 * @param attr the attribute to initialize
	 * @param maximum the maximum amount possible
	 * @param currentLevel the actual amount the player has
	 */
	public void initAttribute(Attribute attr, int maximum, int currentLevel);
	
	/**
	 * Used to get the current level in the attribute.  Does not return the
	 * maximum value.
	 * 
	 * @param attr
	 * @param amountToIncrease
	 */
	public int getAttribute(Attribute attr);

	/**
	 * returns the max value for the given attribute, such as:
	 * initAttribute(Hitpoints, 10, 5) where 10 is the maximum amount of hitpoints
	 * this player can have, but currently they have only half that amount (5), then
	 * will return 10.
	 * 
	 * @param attr
	 * @return
	 */
	int getMaxAttribute(Attribute attr);

	/**
	 * Allows the creature to attack in melee combat.
	 * @param pc
	 */
	void attack(Creature pc);

	/**
	 * Used to update the creatures state and position.
	 * @param location
	 */
	void update(Location location);
	void draw(ViewPlatform console);
}
